import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_subscription_info_cancellation_survey_reason.dart';
import 'package:backend.purchases/domain/entities/google_play_api/google_play_api_purchased_subscription_cancellation_survey_reason.dart';

abstract class CreateGooglePlayPurchasedSubscriptionInfoCancellationSurveyReasonFromApiOne {
  GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason call({
    required GooglePlayApiPurchasedSubscriptionCancellationSurveyReason apiSurveyReason,
  });
}

class CreateGooglePlayPurchasedSubscriptionInfoCancellationSurveyReasonFromApiOneImpl
    implements CreateGooglePlayPurchasedSubscriptionInfoCancellationSurveyReasonFromApiOne {
  const CreateGooglePlayPurchasedSubscriptionInfoCancellationSurveyReasonFromApiOneImpl();

  @override
  GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason call({
    required GooglePlayApiPurchasedSubscriptionCancellationSurveyReason apiSurveyReason,
  }) {
    switch (apiSurveyReason) {
      case GooglePlayApiPurchasedSubscriptionCancellationSurveyReason.unspecified:
        return GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason.unspecified;
      case GooglePlayApiPurchasedSubscriptionCancellationSurveyReason.other:
        return GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason.other;
      case GooglePlayApiPurchasedSubscriptionCancellationSurveyReason.insufficientUse:
        return GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason.insufficientUse;
      case GooglePlayApiPurchasedSubscriptionCancellationSurveyReason.technicalIssues:
        return GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason.technicalIssues;
      case GooglePlayApiPurchasedSubscriptionCancellationSurveyReason.cost:
        return GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason.cost;
      case GooglePlayApiPurchasedSubscriptionCancellationSurveyReason.notBestApp:
        return GooglePlayPurchasedSubscriptionInfoCancellationSurveyReason.notBestApp;
    }
  }
}
